
    TestCase
    (
        'ie.ondevice.objectkit.extension.StringTestCase'

    ,   {
            /*
             * In order to qualift, a value must be a string with 0 length
             * or all whitespace characters
             */
            testStringNotEmpty: function () 
            {
                var notString= 0
                ,   whitespace= '\r\n\t '
                ,   value= 'value'
                ,   zeroLength= ''
                
                
                assertTrue('the zeroLength string is a string', String.is(zeroLength));
                assertTrue('the zeroLength string is empty', zeroLength.isEmpty());
                
                assertFalse('zero length strings do not qualify', String.notEmpty(zeroLength));
                assertFalse('whitepsace strings do not qualify', String.notEmpty(whitespace));
                assertFalse('non strings do not qualify', String.notEmpty(notString));
                assertTrue('primitive strings with content qualify', String.notEmpty(value));
                assertTrue('object strings with content qualify', String.notEmpty(Object(value)));
            }
            
        ,   testStringEmpty: function () 
            {
                var firstSubject= ''
                ,   secondSubject= '\n\r\t\ '
                ,   thirdSubject= new String
                ,   fourthSubject= new Object
                
                assertTrue('Primitive empty strings qualify', String.empty(firstSubject));
                assertTrue('Object empty strings qualify', String.empty(thirdSubject));
                assertTrue('pure whitespace strings qualify', String.empty(secondSubject))
                assertFalse('Non strings do not qualify', String.empty(fourthSubject));
            }
            
        ,   testIsEmpty: function () 
            {
                var whitespace= '   \r\t\n  '
                ,   character= 'a'
                ,   empty= ''
                
                assertTrue('whitespace strings are considered empty', whitespace.isEmpty())
                assertTrue('empty string are considered empty', empty.isEmpty());
                assertFalse('Any string with at least one non-whitespace character is not empty', character.isEmpty());
            }
            
        ,   testTrim: function () 
            {
                var word= 'word'
                ,   whitespace= '\t\n\r '
                ,   right= word + whitespace
                ,   left= whitespace + word
                ,   both= whitespace + word + whitespace
                
                
                assertSame('trim performs trim left', word, left.trim());
                assertSame('trim performs trim right', word, right.trim());
                assertSame('trime performs left and right', word, both.trim());
            }
            
        ,   testBeginsWith: function () 
            {
                var prefix= 'a'
                ,   string= prefix + 'b'
                ,   empty= '';
                
                assertSame('The string to be tested is ab', string, 'ab');
                assertTrue('The string begins with a', string.beginsWith(prefix));
                assertTrue('Empty strings always return true with beginsWith', string.beginsWith(empty));
            }
            
        ,   testEndsWith: function () 
            {
                var suffix= 'a'
                ,   string= 'b' + suffix
                ,   empty= '';
                
                assertSame('The string to be tested is ab', string, 'ba');
                assertTrue('The string ends with a', string.endsWith(suffix));
                assertTrue('Empty strings always return true with endsWith', string.endsWith(empty));
            }
            
        ,   testPrepend: function () 
            {
                var word= 'word'
                ,   prefix= 'prefix'
                ,   result= word.prepend(prefix)
                ;
                
                assertInstanceOf('prepend always returns string object', Object, result);
                assertEquals('the result is prefixword', prefix + word, result);
                assertTrue('The word begins with the prefix', result.beginsWith(prefix));
                assertSame('The original string was not modified', word, 'word');
            }
            
        ,   testAppend: function () 
            {
                var word= 'word'
                ,   suffix= 'suffix'
                ,   result= word.append(suffix)
                ;
                
                assertInstanceOf('prepend always returns string object', Object, result);
                assertEquals('the result is wordsuffix', word + suffix, result);
                assertTrue('The word begins with the prefix', result.endsWith(suffix));
                assertSame('The original string was not modified', word, 'word');
            }
        }
    );